<template>
  <div class="navBar">
    <van-nav-bar
      class="nav"
      @click-left="$router.push(path)"
      @click-right="clickRight"
    >
      <template #left v-if="showInfo">
        <i class="iconfont f44">&#xe637;</i>
      </template>
      <template #title>
        <div class="title">{{ title }}</div>
      </template>
      <template #right>
        <div class="right">{{ rightText }}</div>
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: "navBar",
  // props: ["title", "path", "rightText"],
  props:{
    title:{
      type:String
    },
    path:{
      type:String
    },
    rightText:{
      type:String
    },
    showInfo:{
      type:Boolean,
      default:true
    }
  },
  methods: {
    clickRight() {
      this.$emit("clickRight");
    },
  },
};
</script>

<style lang="less" scoped>
.navBar {
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: left;
    color: #222222;
    line-height: 25px;
    letter-spacing: 0px;
  }
  .right {
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
}
</style>